package cn.lili.modules.order.order.serviceimpl;

import cn.lili.modules.goods.entity.vos.yunxin.CallBackVO;
import cn.lili.modules.order.order.entity.dos.MessageTypeFlow;
import cn.lili.modules.order.order.mapper.MessageTypeFlowMapper;
import cn.lili.modules.order.order.service.MessageTypeFlowService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 异常流水日志业务层
 *
 * @author Chopper
 * @since 2020-02-25 14:10:16
 */
@Service
public class MessageTypeFlowServiceImpl extends ServiceImpl<MessageTypeFlowMapper, MessageTypeFlow> implements MessageTypeFlowService {

    @Override
    public void saveCall(CallBackVO callBackVO) {
        MessageTypeFlow messageTypeFlow = new MessageTypeFlow();
        messageTypeFlow.setMessageType(callBackVO.getMessage_type());
        messageTypeFlow.setJsonVal(JSONObject.toJSONString(callBackVO));
        messageTypeFlow.setProductId(callBackVO.getProduct_id());
        messageTypeFlow.setOrderNo(callBackVO.getOrder_sn());
        messageTypeFlow.setSupplier("1");
        super.save(messageTypeFlow);
    }
}